package org.ru.mse10.cvis.entity.cv;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.ru.mse10.cvis.entity.misc.DateRange;
import org.ru.mse10.cvis.entity.misc.Identity;

/**
 * The Class EducationEntry.
 */
@Entity
@Table(name = "education_entry")
public class EducationEntry extends Identity {

	/** The institution. */
	private String institution;

	/** The degree. */
	private String degree;

	/** The range. */
	private DateRange range;

	/** The cv data. */
	private CvData cvData;

	/**
	 * Gets the institution.
	 * 
	 * @return the institution
	 */
	public String getInstitution() {
		return institution;
	}

	/**
	 * Sets the institution.
	 * 
	 * @param institution
	 *            the new institution
	 */
	public void setInstitution(String institution) {
		this.institution = institution;
	}

	/**
	 * Gets the degree.
	 * 
	 * @return the degree
	 */
	public String getDegree() {
		return degree;
	}

	/**
	 * Sets the degree.
	 * 
	 * @param degree
	 *            the new degree
	 */
	public void setDegree(String degree) {
		this.degree = degree;
	}

	/**
	 * Gets the range.
	 * 
	 * @return the range
	 */
	@OneToOne(cascade = CascadeType.ALL)
	public DateRange getRange() {
		return range;
	}

	/**
	 * Sets the range.
	 * 
	 * @param range
	 *            the new range
	 */
	public void setRange(DateRange range) {
		this.range = range;
	}

	/**
	 * Gets the cv data.
	 * 
	 * @return the cv data
	 */
	@ManyToOne
	public CvData getCvData() {
		return cvData;
	}

	/**
	 * Sets the cv data.
	 * 
	 * @param cvData
	 *            the new cv data
	 */
	public void setCvData(CvData cvData) {
		this.cvData = cvData;
	}

}
